package com.yonyou.pmclouds.projectpart.entity;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.basecom.util.CommonProgramConsts;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@Table(name = "pmbd_projectpart")
public class ProjectPartVO extends SuperVO {
    public static final String PK_PROCEDURE = "pkProjectpart";
    public static final String ENABLE_STATUS = "enableStatus";

    @NotNull(message = "主键为空",groups = ProjectPartVO.UpdateValid.class)
    @Size(min = CommonProgramConsts.UUID_STRING_LENGTH,
            max = CommonProgramConsts.UUID_STRING_LENGTH, groups = ProjectPartVO.UpdateValid.class)
    @Id
    private String pkProjectpart;
    private String pkTenant;
    @NotNull(groups = ProjectPartVO.InsertValid.class)
    @Size(message = "部位编码长度应在1到50之间",min = 1, max = 50, groups = ProjectPartVO.InsertValid.class)
    private String scode;
    @NotNull
    @Size(min = 1, max = 50)
    private String sname;
    private String pkParent;
    @NotNull(message = "请选择项目",groups = {ProjectPartVO.QueryValid.class,ProjectPartVO.UpdateValid.class,ProjectPartVO.InsertValid.class})
    @Size(message = "请选择项目",min = 1, max = 50,groups = {ProjectPartVO.QueryValid.class,ProjectPartVO.UpdateValid.class,ProjectPartVO.InsertValid.class})
    private String pkProject;
    private String innerCode;
    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;
    //启用状态（0：停用，1：启用）
    private Byte enableStatus;
    @Transient
    private ProjectPartVO[] childProjectpart;
    //父级编码
    @Transient
    private String pcode;
    //父级名称
    @Transient
    private String pname;
    //父级节点内码
    @Transient
    private String parentInnerCode;
    //内码长度，特用于数据库查询
    @Transient
    private Integer innerCodeLen;
    @Transient
    private String operatePK;
    @Transient
    private Byte queryStatus;

    public interface UpdateValid {
    }
    public interface InsertValid {
    }
    public interface QueryValid {
    }
}
